# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1InputConfig do
  @moduledoc """
  The configuration of input data, including data type, location, etc.

  ## Attributes

  *   `annotationType` (*type:* `String.t`, *default:* `nil`) - Optional. The type of annotation to be performed on this data. You must specify this field if you are using this InputConfig in an EvaluationJob.
  *   `bigquerySource` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1BigQuerySource.t`, *default:* `nil`) - Source located in BigQuery. You must specify this field if you are using this InputConfig in an EvaluationJob.
  *   `classificationMetadata` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1ClassificationMetadata.t`, *default:* `nil`) - Optional. Metadata about annotations for the input. You must specify this field if you are using this InputConfig in an EvaluationJob for a model version that performs classification.
  *   `dataType` (*type:* `String.t`, *default:* `nil`) - Required. Data type must be specifed when user tries to import data.
  *   `gcsSource` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1GcsSource.t`, *default:* `nil`) - Source located in Cloud Storage.
  *   `textMetadata` (*type:* `GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1TextMetadata.t`, *default:* `nil`) - Required for text import, as language code must be specified.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotationType => String.t() | nil,
          :bigquerySource =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1BigQuerySource.t()
            | nil,
          :classificationMetadata =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1ClassificationMetadata.t()
            | nil,
          :dataType => String.t() | nil,
          :gcsSource =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1GcsSource.t() | nil,
          :textMetadata =>
            GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1TextMetadata.t()
            | nil
        }

  field(:annotationType)

  field(:bigquerySource,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1BigQuerySource
  )

  field(:classificationMetadata,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1ClassificationMetadata
  )

  field(:dataType)

  field(:gcsSource,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1GcsSource
  )

  field(:textMetadata,
    as: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1TextMetadata
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1InputConfig do
  def decode(value, options) do
    GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1InputConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DataLabeling.V1beta1.Model.GoogleCloudDatalabelingV1beta1InputConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
